# $Id$
# Maintainer: Jan de Groot <jgc@archlinux.org>

pkgname=upower
pkgver=0.99.6
pkgrel=1
pkgdesc="Abstraction for enumerating power devices, listening to device events and querying history and statistics"
arch=('i686' 'x86_64')
url="http://upower.freedesktop.org"
license=('GPL')
depends=('systemd' 'libusb' 'libimobiledevice' 'libgudev')
makedepends=('intltool' 'docbook-xsl' 'gobject-introspection' 'python2' 'git' 'gtk-doc')
backup=('etc/UPower/UPower.conf')
_commit=98d98fcbd039e66eb161d1d1e44d079a15ae2ef4  # tags/UPOWER_0_99_6^0
source=(git://anongit.freedesktop.org/upower#commit=$_commit)
md5sums=('SKIP')

pkgver() {
  cd $pkgname
  git describe --tags | sed -e 's/UPOWER_//' -e 's/_/\./g' -e 's/-/+/g'
}

build() {
  cd $pkgname

  NOCONFIGURE=1 ./autogen.sh

  ./configure \
    --prefix=/usr \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --libexecdir=/usr/lib/$pkgname \
    --disable-static
  make
}

package() {
  cd $pkgname
  make DESTDIR="$pkgdir" install
}
